package com.atguigu.jxc.controller;

import com.atguigu.jxc.domain.ServiceVO;
import com.atguigu.jxc.entity.DamageList;
import com.atguigu.jxc.service.DamageListGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpSession;
import java.util.Map;

@RestController
@RequestMapping("/damageListGoods")
public class DamageListGoodsController {

    @Autowired
    private DamageListGoodsService damageListGoodsService;

    /**
     * 保存报损单
     * @param damageList
     * @param damageListGoodsStr
     * @return
     */
    @PostMapping(value = "/save")
    @ResponseBody
    public ServiceVO save(DamageList damageList, String damageListGoodsStr, HttpSession session){
       return damageListGoodsService.save(damageList,damageListGoodsStr,session);
    }
    @PostMapping("/list")
    @ResponseBody
    public Map<String,Object> list(String  sTime, String  eTime){
        return damageListGoodsService.list(sTime,eTime);
    }

    @PostMapping("/goodsList")
    @ResponseBody
    public Map<String,Object> goodsList(Integer damageListId){
        return damageListGoodsService.goodsList(damageListId);
    }



}
